function t(t) {
    return (t = t.toString())[1] ? t : "0" + t;
}

String.prototype.trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}, String.prototype.isEmpty = function() {
    return "" == this.trim();
}, module.exports = {
    formatTime: function(e) {
        var n = e.getFullYear(), r = e.getMonth() + 1, a = e.getDate(), o = e.getHours(), i = e.getMinutes(), u = e.getSeconds();
        return [ n, r, a ].map(t).join("/") + " " + [ o, i, u ].map(t).join(":");
    },
    getCurrentData: function() {
        var t = new Date();
        return {
            date: new Date(),
            year: t.getFullYear(),
            month: t.getMonth() + 1,
            day: t.getDate(),
            weekday: t.getDay()
        };
    },
    isFunction: function(t) {
        return "function" == typeof t;
    },
    formatTimeToString: function(t) {
        if ("string" == typeof t) {
            var e = new RegExp("\\-", "gi");
            t = t.replace(e, "/");
        }
        var n = +new Date() - Date.parse(t), r = Math.floor(n / 864e5);
        if ("NaN" == typeof n || r > 0) return t;
        var a = n % 864e5, o = Math.floor(a / 36e5);
        if (o > 0) return o + "小时前";
        var i = a % 36e5, u = Math.floor(i / 6e4);
        return u > 1 ? u + "分钟前" : "刚刚";
    },
    getQueryString: function(t) {
        var e = new RegExp("(^|&)" + t + "=([^&]*)(&|$)", "i"), n = new RegExp("(^|/)" + t + "/([^/]*)(/|$)", "i"), r = window.location.search.substr(1).match(e), a = window.location.pathname.substr(1).match(n);
        return null != r ? unescape(r[2]) : null != a ? unescape(a[2]) : null;
    }
};